function nameList = extractLHIImageName(path_list)
% test case:
% nameList = extractLHIImageName('D:\Datasets\CarImages\LHIHightTilt')


nameList = [];
for i_folder = 1:length(path_list)
	curr_path = path_list{i_folder};
	tmp_name_list = findImageFolderAndNames(curr_path);
	nameList=[nameList;tmp_name_list];
end

end






function nameList = findImageFolderAndNames(current_path)
pathList = dir(current_path);
nameList = struct('path',{},'name',{});
for iPath = 1:length(pathList)
    if ~pathList(iPath).isdir || strcmp(pathList(iPath).name, '.')|| ...
            strcmp(pathList(iPath).name,'..');
        continue;
    end
    img_path =dir( [current_path '/' pathList(iPath).name '/' ]);
    noPath = true;
    for jPath = 1:length(img_path)
        if isempty(regexp(img_path(jPath).name,'[\s]*[S|s]cale[\s]*2', 'once'));
            continue;
        else
            noPath = false;
            tmp.path =  [current_path '/' pathList(iPath).name '/' img_path(jPath).name ];
            tmp.name = 'null';
            name_list = dir([tmp.path '/*.jpg']);
            if(isunix)
                name_list_JPG = dir([tmp.path '/*.JPG']);
                name_list = [name_list;name_list_JPG];
            end
            if isempty(name_list)
                disp('warning, can not find jpg format image in:');
                disp(tmp.path)
            else
                tmp.name = name_list.name;
                nameList = [nameList;tmp];
                continue;
            end
        end
    end
    if noPath
        disp(['warning: can not find proper image path in: '])
        disp( [current_path '/' pathList(iPath).name '/' ]);
    end
end
end
